#version: '3.1'
#
#services:
#  web:
#    image: tomcat:9.0.43-jdk15-openjdk-slim
#    restart: always
#    container_name: lib_assistant_app
#    ports:
#        - "8080:8080"
#    volumes:
#      - ./libAssistant.war:/usr/local/tomcat/webapps/libAssistant.war
#    environment:
#      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/postgres
#      - SPRING_DATASOURSE_USERNAME=john
#      - SPRING_DATASOURCE_PASSWORD=123456
#      #POSTGRES_PASSWORD: 123456
#      #POSTGRES_USER: 'john'
#      #DB_HOST: 'db'
#
#    networks:
#      - appnet
#    links:
#      - db
#    depends_on:
#      - db
#  db:
#    image: postgres
#    restart: always
#    container_name: lib_assistant_db
#    environment:
#      POSTGRES_PASSWORD: 123456
#      POSTGRES_USER: 'john'
#      POSTGRES_DB: 'book_db'
#      PGDATA: '/home/data'
#
#    networks:
#      - appnet
#    ports:
#      - "5432:5432"
#
#networks:
#  appnet:


version: '3.1'

services:
  db:
    image: postgres
    restart: always
    container_name: lib_db
    environment:
      POSTGRES_PASSWORD: 123456
      POSTGRES_USER: john
      POSTGRES_DB: book_db
      PGDATA: /home/data

    ports:
      - "5432:5432"
